// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

import Vconsole from 'vconsole'
if ( process.env.NODE_ENV !== 'development' && process.env.NODE_ENV !== 'production' ) {
  const vConsole = new Vconsole()
  Vue.use(vConsole)
}
console.log('环境变量', process.env.NODE_ENV)
import commonComponents from '@/components/common'
Vue.use(commonComponents)
// import "lib-flexible/flexible";
// import './utils/rem'
import MyLoading from "@/components/MyLoading"
Vue.use(MyLoading)

import Loading from '@/components/loading.js'
Vue.use(Loading)

Vue.config.productionTip = false

import '@/directive/index'
import '@/utils/api'
// import Directive from "@/directive/index";
// // 使用插件
// Vue.use(Directive);

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App />'
})

// router.beforeEach((to, from, next) => {
//   /* 路由发生变化修改页面title */
//   if (to.meta.title) {
//     document.title = to.meta.title;
//   }
//   next();
// });
